package dm

import (
	"github.com/go-ole/go-ole"
	"log"
)

func (com *DmSoft) FindPic(x1, y1, x2, y2 int, picName string, deltaColor string, sim float32, dir int, intX, intY *int) int {
	x := ole.NewVariant(ole.VT_I4, 0)
	y := ole.NewVariant(ole.VT_I4, 0)
	ret, _ := com.dm.CallMethod("FindPic", x1, y1, x2, y2, picName, deltaColor, sim, dir, &x, &y)
	*intX = int(x.Val)
	*intY = int(y.Val)
	x.Clear()
	y.Clear()
	return int(ret.Val)
}

func (com *DmSoft) TestPic() int {
	var intX int
	var intY int
	ret := com.FindPic(0, 0, 2000, 2000, "C:\\Users\\maquanwei\\Desktop\\plan_go\\dm\\bmp\\uvr5_start.bmp", "000000", 0.8, 0, &intX, &intY)
	log.Println("intx,inty,getLastError:", intX, intY, com.GetLastError())
	return ret
}
